package ControlLayer;
import ModelLayer.Employee;
import DBLayer.DBEmployee;
import java.util.ArrayList;

public class CtrEmployee {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrEmployee instance = null;
    DBEmployee dbEmployee = new DBEmployee();

    public CtrEmployee() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrEmployee getInstance() {
        if (instance == null) {
            instance = new CtrEmployee();
        }
        return instance;
    }

    public ArrayList<Employee> getEmployeeList() {
        return dbEmployee.getEmployeeList();
    }

    public Employee getEmployeeByID(int id) {
        return dbEmployee.getEmployeeByID(id);
    }

    public int addEmployee(Employee employee) {
        return dbEmployee.addEmployee(employee);
    }

    public int updateEmployee(Employee employee, int id) {
        return dbEmployee.updateEmployee(employee, id);
    }

    public void deleteEmployee(int id) {
        dbEmployee.deleteEmployee(id);
    }
    // </editor-fold>
}
